<?php
namespace Swiftx\DataBase\Driver;
use Swiftx\DataBase\Exception;
use Swiftx\DataBase\Interfaces\Dialect;
use Swiftx\DataBase\Interfaces\Driver;
use Swiftx\DataBase\Interfaces\Page;
use Swiftx\DataBase\Interfaces\Picker;

/**
 * ---------------------------------------------------------------------------------------------------------------
 * 数据库对象
 * ---------------------------------------------------------------------------------------------------------------
 * @author      胡永强 <odaytudio@gmail.com>
 * @since       2014-11-06
 * @copyright   Copyright (c) 2014-2015 ymaplus Inc.
 * ---------------------------------------------------------------------------------------------------------------
 */
class Mysql extends Driver {


    /**
     * ----------------------------------------------------------
     * 进行数据库连接
     * ----------------------------------------------------------
     * @return mixed
     * ----------------------------------------------------------
     * @throws Exception 301 数据库连接失败
     * ----------------------------------------------------------
     */
    protected function Connect()
    {
        // TODO: Implement Connect() method.
    }

    /**
     * ----------------------------------------------------------
     * 数据库查询
     * ----------------------------------------------------------
     * @param $sql
     * ----------------------------------------------------------
     * @return array
     * ----------------------------------------------------------
     */
    public function Query($sql)
    {
        // TODO: Implement Query() method.
    }

    /**
     * ----------------------------------------------------------
     * 获取一条记录
     * ----------------------------------------------------------
     * @param Dialect $sql
     * ----------------------------------------------------------
     * @return array
     * ----------------------------------------------------------
     */
    public function QueryRow(Dialect $sql)
    {
        // TODO: Implement QueryRow() method.
    }

    /**
     * ----------------------------------------------------------
     * 获取多条记录
     * ----------------------------------------------------------
     * @param Dialect $sql 数据库语句
     * @param int $number
     * @param int $start
     * ----------------------------------------------------------
     * @return array
     * ----------------------------------------------------------
     */
    public function QueryRows(Dialect $sql, $number = 0, $start = 0)
    {
        // TODO: Implement QueryRows() method.
    }

    /**
     * ----------------------------------------------------------
     * 获取一个查询值
     * ----------------------------------------------------------
     * @param Dialect $sql
     * @param string $name
     * ----------------------------------------------------------
     * @return mixed
     * ----------------------------------------------------------
     */
    public function QueryValue(Dialect $sql, $name)
    {
        // TODO: Implement QueryValue() method.
    }

    /**
     * ----------------------------------------------------------
     * 进行分页查询
     * ----------------------------------------------------------
     * @param Dialect $sql
     * @param int $current
     * @param int $number
     * ----------------------------------------------------------
     * @return Page
     * ----------------------------------------------------------
     */
    public function Page(Dialect $sql, $current, $number)
    {
        // TODO: Implement Page() method.
    }

    /**
     * ----------------------------------------------------------
     * 统计记录数
     * ----------------------------------------------------------
     * @param Dialect|string $sql
     * ----------------------------------------------------------
     * @return int
     * ----------------------------------------------------------
     */
    public function Count($sql)
    {
        // TODO: Implement Count() method.
    }

    /**
     * ----------------------------------------------------------
     * 执行Sql语句
     * ----------------------------------------------------------
     * @param string $sql
     * ----------------------------------------------------------
     * @return int
     * ----------------------------------------------------------
     */
    public function Excuse($sql)
    {
        // TODO: Implement Excuse() method.
    }

    /**
     * ----------------------------------------------------------
     * 执行插入操作
     * ----------------------------------------------------------
     * @param string $table
     * @param array $data
     * ----------------------------------------------------------
     * @return int
     * ----------------------------------------------------------
     */
    public function Insert($table, array $data)
    {
        // TODO: Implement Insert() method.
    }

    /**
     * ----------------------------------------------------------
     * 执行修改操作
     * ----------------------------------------------------------
     * @param Dialect $sql
     * @param array $data
     * ----------------------------------------------------------
     * @return int
     * ----------------------------------------------------------
     */
    public function Update(Dialect $sql, array $data)
    {
        // TODO: Implement Update() method.
    }

    /**
     * ----------------------------------------------------------
     * 执行删除操作
     * ----------------------------------------------------------
     * @param Dialect $sql
     * ----------------------------------------------------------
     * @return int
     * ----------------------------------------------------------
     */
    public function Delete(Dialect $sql)
    {
        // TODO: Implement Delete() method.
    }

    /**
     * ----------------------------------------------------------
     * 数据表清空操作
     * ----------------------------------------------------------
     * @param string $table
     * ----------------------------------------------------------
     * @return bool
     * ----------------------------------------------------------
     */
    public function Clean($table)
    {
        // TODO: Implement Clean() method.
    }

    /**
     * 事物方式执行
     * @param mixed $excuse
     * @param null $success
     * @param null $error
     * @return mixed
     */
    public function Transaction($excuse, $success = null, $error = null)
    {
        // TODO: Implement Transaction() method.
    }

    /**
     * ----------------------------------------------------------
     * 创建拾取器
     * ----------------------------------------------------------
     * @return Picker
     * ----------------------------------------------------------
     */
    function NewPicker()
    {
        // TODO: Implement NewPicker() method.
    }

    /**
     * ----------------------------------------------------------
     * 创建Sql构造器
     * ----------------------------------------------------------
     * @return Dialect
     * ----------------------------------------------------------
     */
    function NewSql()
    {
        // TODO: Implement NewSql() method.
    }
}